home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / superplay-lib_dev / programmers / example_tools / listspos / listspos_subs.c < prev    next >
C/C++ Source or Header  |  1996-05-27  |  2KB  |  58 lines

  1. /* ======================================================================== */
  2. /* = Programmname    : ListSPOs_Subs V1.5                                 = */
  3. /* =                                                                      = */
  4. /* ======================================================================== */
  5. /* = Autor/Copyright : (c) 1994 by Andreas Ralph Kleinert.                = */
  6. /* =                   All rights reserved.                               = */
  7. /* ======================================================================== */
  8. /* = Funktion        : Sub-Routines for ListSPOs V1.5                     = */
  9. /* =                                                                      = */
  10. /* ======================================================================== */
  11. /* = Compiler        : SAS/C V6.51                                        = */
  12. /* =                                                                      = */
  13. /* ======================================================================== */
  14.  
  15. #include <dos.h> /* to prevent multiple include, include this at FIRST ! */
  16.  
  17. #include <exec/types.h>
  18. #include <exec/memory.h>
  19.  
  20. #include <proto/exec.h>
  21. #include <proto/dos.h>
  22.  
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26.  
  27.  
  28. #define N (NULL) /* as usual */
  29.  
  30.  
  31. void __stdargs SP_Printf(char *formatstring, ...);
  32.  
  33.  
  34. /* *************************************************** */
  35. /* *                                                 * */
  36. /* * SP_Printf : Replacement for printf()-Output     * */
  37. /* *                                                 * */
  38. /* *************************************************** */
  39.  
  40. #define KIP_BUFLEN (1200)
  41.  
  42. extern void Fmt(void);
  43.  
  44. void __stdargs SP_Printf(char *formatstring, ...)
  45. {
  46.  UBYTE *buffer;
  47.  
  48.  buffer = (BYTE *) AllocMem(KIP_BUFLEN, MEMF_CLEAR);
  49.  if(buffer)
  50.   {
  51.    RawDoFmt((APTR) formatstring, (APTR) (((ULONG *)&formatstring)+1), (APTR) &Fmt, (APTR) buffer);
  52.  
  53.    Write(Output(), buffer, strlen(buffer));
  54.  
  55.    FreeMem(buffer, KIP_BUFLEN);
  56.   }
  57. }
  58.